<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2016/6/12
  Time: 14:20
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <link rel="stylesheet" href="/wechat/ucenter/records.css">
    <jsp:include page="../public/head.jsp" flush="true" />
</head>
<body>
<jsp:include page="../public/header.jsp" flush="true" />
<div class="my_records">
    <section>
        <!-- 区域列表 -->
        <div class="area_1" id="data">
            <%--<c:forEach items="${recharges}" var="item">--%>
            <%--<a>--%>
                <%--<div class="areaList">--%>
                    <%--<span class="s1">${item.payType}</span>--%>
                    <%--<span class="s2">+${item.money}</span>--%>
                    <%--<span class="s3">${item.payTime}</span>--%>
                    <%--<span class="s4">${item.payState}</span>--%>
                <%--</div>--%>
            <%--</a>--%>
            <%--</c:forEach>--%>
            <div class="statusing" id="pullRefresh" >正在加载...</div>
        </div>
    </section>
</div>

<script>

    var isLast = false;

    $(function () {
       update();
    });

    function update() {
        $.post("/mobile/recharge?action=list",{accountId:${userinfo.id}},function (data) {
            if (!data.success){
                tip("",data.msg,true);
            }else {
                if (data.data.length > 0){
                    $("#pullRefresh").toggle();
                    var html = "";
                    $.each(data.data,function (i,item) {
                       html +=
                        '<a>'+
                        '<div class="areaList">'+
                        '       <span class="s1">'+item.payType+'</span>'+
                        '       <span class="s2">+'+item.money+'</span>'+
                        '       <span class="s3">'+item.addTime+'</span>'+
                        '       <span class="s4">交易已完成</span>'+
                        '       </div>'+
                        '       </a>';
                    });
                    $("#data").append(html);
                }else{
                    $("#pullRefresh").text("无充值记录");
                }
            }
        },"json");
    }
</script>
</body>
</html>
